﻿/*----------------------------------------------------------------
//  <copyright file="IFunctionStore.cs" company="MicroCloud@151504200868">
//      Copyright © 2020-2024 MicroCloud Corporation, All rights reserved.
//  </copyright>
//  <site>https://gitee.com/chenmm123/microclouds</site>
//  <last-editor>cmm</last-editor>
//  <last-date>2022-11-16 16:13</last-date>
//----------------------------------------------------------------*/

namespace MicroCloud.Authorization
{
    #region "定义功能信息存储"
    /// <summary>
    /// 定义功能信息存储
    /// </summary>
    /// <typeparam name="TFunction">功能信息类型</typeparam>
    /// <typeparam name="TFunctionInputDto">功能信息输入DTO类型</typeparam>
    [IgnoreDependency]
    public interface IFunctionStore<TFunction, in TFunctionInputDto>
        where TFunction : IFunction
        where TFunctionInputDto : FunctionInputDtoBase
    {
        #region "属性"
        #region "获取 功能信息查询数据集"
        /// <summary>
        /// 获取 功能信息查询数据集
        /// </summary>
        IQueryable<TFunction> Functions { get; }
        #endregion

        #endregion

        #region "方法"
        #region "检查功能信息是否存在"
        /// <summary>
        /// 检查功能信息是否存在
        /// </summary>
        /// <param name="predicate">检查谓语表达式</param>
        /// <param name="id">更新的功能信息编号</param>
        /// <returns>功能信息是否存在</returns>
        Task<bool> CheckFunctionExists(Expression<Func<TFunction, bool>> predicate, long id = default);
        #endregion
        #region "更新功能信息"
        /// <summary>
        /// 更新功能信息
        /// </summary>
        /// <param name="dtos">包含更新信息的功能信息DTO信息</param>
        /// <returns>业务操作结果</returns>
        Task<OperationResult> UpdateFunctions(params TFunctionInputDto[] dtos);
        #endregion

        #endregion

    }
    #endregion

}
